﻿using System;
using eShop.Business;
using System.Collections.Generic;
using Ext.Net;

public partial class admin_inqueries : SiteAdminBasePage
{
    

    protected void Page_Load(object sender, EventArgs e)
    {
        uccResponseMessage.Visible = false;

    }

    protected void Store1_RefreshData(object sender, StoreRefreshDataEventArgs e)
    {
        BindCustomers("InquiryId", e.Start, e.Limit);
    }


    private void BindCustomers(string sort, int start, int limit)
    {
        List<Inquires> pagedCustomer = null;
        int totalCount = 0;
        start = start * limit;
       
        pagedCustomer = Inquires.GetInquires(sort, start, limit);
        totalCount = Inquires.TotalInquires();
        Store1.DataSource = pagedCustomer;
        Store1.DataBind();

        (Store1.Proxy[0] as PageProxy).Total = totalCount;
    }

    [DirectMethod(Namespace = "EShop.WebService")]
    public void SearchCustomer()
    {
        Store1.DataBind();
    }
}